catchup: pause catchup if ledger lagging behind#5794
catchup: pause catchup if ledger lagging behind#5794algorandskiy merged 13 commits intoalgorand:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5794 +/- ##
=======================================
Coverage 55.55% 55.55%
=======================================
Files 474 474
Lines 66850 66877 +27
=======================================
+ Hits 37138 37153 +15
- Misses 27188 27199 +11
- Partials 2524 2525 +1
... and 11 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Thanks for the review, pushed fixes |
78830a8 to
63ef58f
Compare
There was a problem hiding this comment.
I understand better now, this doesn't strictly stop catchup from downloading more blocks than the max: it only stops catchup if the max deltas is exceeded AND the commitSyncer is running inside the transaction context used to call trackers' commitRound() functions. So as a side effect of DB flushing taking a while, once you exceed the max, you have a high chance of an IsBehind call noticing and catchup being stopped, and maybe another block or two could sneak in past the max. But the net effect is this PR will force catchup to wait for a slow DB flush operation to finish before continuing.
e85936b
|
Added pausing |



Summary
It is possible catchup downloads blocks faster than ledger commits it slow disks. This could cause OOM because of too many pending deltas.
Implementation overview
Ledger.Available()method.MaxAcctLookbackis manually set greater than 256, useMaxAcctLookback+1as a new max.Additionally moved
trackerRegistry.dbRoundinitialization frominitializetoloadFromDiskto 1) simplify testing 2) it seems naturally belongs toloadFromDisk.Considered improvement(s) [not implemented]
Test Plan
Added unit tests to catchup and ledger packages.
Run a manual mainnet catchup test.
.details.NewBase - .details.OldBase